<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="/WEB-INF/jspf/meta/meta.jspf"%>
<title>添加宿舍信息</title>
<%@include file="/WEB-INF/jspf/adminPage.jspf"%>


</head>
<body>
	<div style="width: 430px; margin: 0px auto;">
		<div style="margin: 20px 0;"></div>
		<div class="easyui-panel" title="添加宿舍信息" style="width:">
			<div style="padding: 10px 60px 20px 60px">
				<form id="ffadd" method="post">
					<table cellpadding="5">
						<tr>
							<td>宿舍名称:</td>
							<td><input class="easyui-textbox" type="text"
								name="roomName" data-options="required:true"></input></td>
						</tr>

						<tr>
							<td>信息备注:</td>
							<td><input class="easyui-textbox" name="roomInfo"
								data-options="multiline:true" style="height: 60px"></input></td>
						</tr>

					</table>
				</form>
				<div style="text-align: center; padding: 5px">
					<a href="javascript:void(0)" class="easyui-linkbutton" onclick='submitForm()'>提交</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清除</a>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		
		function submitForm(){
			$('#ffadd').form({
				url:'<%=request.getContextPath()%>/room/addRoom.json',
				onSubmit : function() {
					return $(this).form('validate');
				},
				success : function(data) {
					var d=JSON.parse(data)
					$.messager.show({
						title:'操作提示',
						msg:d.msg,
						timeout:3000,
						showType:'slide'
					});
					$('#ffadd').form('clear');
				}
			})
			$('#ffadd').submit()
		}
		function clearForm() {
			$('#ffadd').form('clear');
		}
	</script>
</body>
</html>